/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum MessageEncoding implements org.f1x.api.message.types.StringEnum {
	ISO_2022_JP("ISO-2022-JP"),
	EUC_JP("EUC-JP"),
	SHIFT_JIS("SHIFT_JIS"),
	UTF_8("UTF-8");

	private final String code;

	MessageEncoding (String code) {
		this.code  = code;
		bytes = code.getBytes();
	}

	public String getCode() { return code; }

	private final byte[] bytes;
	public byte[] getBytes() { return bytes; }


	public static MessageEncoding parse(String s) {
		switch(s) {
			case "ISO-2022-JP" : return ISO_2022_JP;
			case "EUC-JP" : return EUC_JP;
			case "SHIFT_JIS" : return SHIFT_JIS;
			case "UTF-8" : return UTF_8;
		}
		return null;
	}

}